<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>    
        function mySort(arr){
            var length = arr.length;
            for(var i=0; i<length; i++){
                for(var j=0;j<length-1-i;j++){
                    if(arr[j]>arr[j+1]){
                        var temp = arr[j];
                        arr[j] = arr[j+1];
                        arr[j+1] = temp;
                    }
                }
            }
            return arr;
        }    

        var arr=[2,5,9,5,4,3,6,6,5,22,26456,6]
        console.log(mySort(arr))
    </script>
</body>
</html>